package com.yunheone.view.Student;

import com.yunheone.control.Studentcontrol;
import com.yunheone.mode.StudentUse;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/8/10 0010.
 */
public class StudentDell {
    public static StudentUse studentDell(){

        System.out.println ("**************学生管理系统—删除学生**************");
        System.out.println ("请输入要删除的学生班级和学号：");
        Scanner input=new Scanner ( System.in );
        System.out.print ("请输入学生班级");
        String grade=input.next ();
        System.out.print ("请输入学生学号");
        String id=input.next ();
        try{
            if (Studentcontrol.getStudentmap ().get ( id )==null){
                throw new Exception ("删除异常：");
            }
            return new StudentUse ( grade,id );
        } catch (Exception e){
            String message = e.getMessage ();
            System.out.println (message!=null?message:"输入不合法");
            return studentDell ();
        }
    }

}
